﻿@model IEnumerable<CmsMediaContentTag>

@{
    Layout = "~/admin/Templates/TelerikAdministration.cshtml";
    ResFile = "cms_Media";
}

@{
    ViewBag.Title = _("Media content tags");
}

<p>
	<a class="b-back-link" href="@(Request.UrlReferrer != null ? Request.UrlReferrer.ToString() : Url.Action("Index", "CmsMedia"))"><i class="b-icon"></i> @_("Back to Media content")</a>
</p>

<h1 class="g-clear">
	<i class="b-icon b-icon_h b-icon_h_media"></i>
	<span class="b-overflow">
		@_("Media content tags management")
	</span>  
</h1>

<div class="categories t-content-inner g-clear">
    <p>
        <a class="add-category b-button" href="@Url.Action("addcategory", "cmsmediacontenttag")">@_("Add new")</a>        
    </p>    
	<fieldset class="b-form hide">
		<ol class="b-form__rows ul-reset g-clear">            	                        
        	<li class="b-form__row g-clear">
		        <label for="tagName">@_("Tag:")</label>
		        <input id="tagName" class="category-name text" name="tagName" type="text" value="" /> 
                <input id="mediaContentTagId" class="category-id" name="mediaContentTagId" type="hidden" value="0" />
                <input class="category-action-url" type="hidden" />
		        <input class="save-category b-button b-button_small" type="submit" value="@_("Save")" />         		
                <a class="cancel-category b-button b-button_small b-button_colour_grey">@_("Cancel")</a>
        	</li>
        </ol>		
	</fieldset>
    @{Html.RenderPartial("ErrorPanel");}    
    @(Html.Telerik().Grid(Model).HtmlAttributes(new { style = "width:300px;" })
        .Name("MediaContentTagGrid")
        .Columns(columns =>
                    {
                        columns.Bound(p => p.TagName).Title(_("Tag"));
                        columns.Template(
                            @<text>
                                <a href="@Url.Action("editcategory", "cmsmediacontenttag", new { id = item.Id })" class="edit-category b-icon b-icon_edit" title="@_("Edit")">@_("Edit")</a>                                
                            </text>)
                        .ClientTemplate("<a href=" + Url.Action("editcategory", "cmsmediacontenttag") + "/<#= Id#> class='edit-category b-icon b-icon_edit' title='"+_("Edit") + "'>"+_("Edit")+"</a>")
                        .Title(_("Edit"));
                        columns.Template(
                            @<text>
                                <a href="@Url.Action("delete", "cmsmediacontenttag", new { id = item.Id })" title="@_("media content tag")" class="b-icon b-icon_delete"/>
                            </text>
                            )
                        .ClientTemplate("<a href=" + Url.Action("delete", "cmsmediacontenttag") + "/<#= Id#> class='delete-category b-icon b-icon_delete' title='"+_("Delete")+"'>"+_("Delete")+"</a>")
                        .Title(_("Delete"));
                    })
        .DataBinding(dataBinding => dataBinding.Ajax().Select("_index", "cmsmediacontenttag"))
        .Pageable(paging => paging.Style(GridPagerStyles.Numeric).PageSize(ViewBag.PageSize).Enabled(ViewBag.Total > ViewBag.PageSize))
    )
    @{Html.RenderPartial("GridSizer", (int)ViewBag.PageSize);}
</div>

